{include file="public/_meta" /}
<link href="/static/admin/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<style>
    /* 新增*/
    .formControls{
       position: relative;
    }
    .iphoneInput{
        position: absolute;
        top:41px;
        left: 21.5%;
        width: 19.3%;
        height: 200px;
        overflow-y: scroll;
        background: #f2f2f2;
        z-index: 100;
        display: none;
    }
    .iphoneInput li{
        height: 30px;
        line-height: 30px;
        text-indent:5px;
        color: #333;
        cursor: pointer;
    }
    .iphoneInput li:hover{
        background: #35acc1;
        color: #fff;
    }
</style>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>商户管理 <span class="c-gray en">&gt;</span> 商户修改 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-article-add">

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">推荐人：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text input_iphone"  name="us_pid_tel" value="{$info['us_pid_text']}" style="width:20%" >
                <input id="select_tel" type="text" class="input-text"  name="select_pid_tel" value="" style="width:20%" >
                <p id="btn" class="btn btn-primary radius" style="margin-top:10px"  ><i class="Hui-iconfont"></i>搜索</p>
                {foreach  $info['select_tel'] as $key=>$vo }
                <input type="hidden" class="select_tel_hidden" value="{$vo}" >
                 {/foreach}
                <ul class="iphoneInput">
                </ul>
            </div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">昵称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" name="us_nickname" value="{$info['us_nickname']}" class="input-text" style="width:20%">
            </div>
    </div>
<!--        <div class="row cl">-->
<!--            <label class="form-label col-xs-4 col-sm-2">真实姓名：</label>-->
<!--            <div class="formControls col-xs-8 col-sm-9">-->
<!--                <input type="text" name="us_realname" value="{$info['us_realname']}" class="input-text" style="width:20%">-->
<!--            </div>-->
<!--        </div>-->
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">手机号码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['us_tel']}" name="us_tel" style="width:20%">
            </div>
        </div>
<!--        <div class="row cl">-->
<!--            <label class="form-label col-xs-4 col-sm-2">银行卡：</label>-->
<!--            <div class="formControls col-xs-8 col-sm-9">-->
<!--                <input type="text" class="input-text" value="{$info['bank_account']}" name="bank_account" style="width:20%">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="row cl">-->
<!--            <label class="form-label col-xs-4 col-sm-2">开户行：</label>-->
<!--            <div class="formControls col-xs-8 col-sm-9">-->
<!--                <input type="text" class="input-text" value="{$info['bank_name']}" name="bank_name" style="width:20%">-->
<!--            </div>-->
<!--        </div>-->
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">支付宝：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['ali_account']}" name="ali_account" style="width:20%">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">微信：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['we_account']}" name="we_account" style="width:20%">
            </div>
        </div>
<!--        <div class="row cl">-->
<!--            <label class="form-label col-xs-4 col-sm-2">身份证：</label>-->
<!--            <div class="formControls col-xs-8 col-sm-9">-->
<!--                <input type="text" class="input-text" value="{$info['us_id_card']}" name="us_id_card" style="width:20%">-->
<!--            </div>-->
<!--        </div>-->
        <!-- <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">账户名：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['us_account']}" style="width:20%" disabled>
            </div>
        </div> -->
<!--        <div class="row cl">-->
<!--            <label class="form-label col-xs-4 col-sm-2">头像：</label>-->
<!--            <div class="formControls col-xs-8 col-sm-9">-->
<!--                <div style="width:110px;height: 110px;position: relative;display: inline-block; ">-->
<!--                    {if condition="$info.us_head_pic"}-->
<!--                        <img src="{$info.us_head_pic}" class="logo" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;">-->
<!--                    {else}-->
<!--                        <img src="/static/admin/img/head3.png" class="logo" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;">-->
<!--                    {/if}-->
<!--                    <input type="file" name="file" onchange="eee($(this))" class="input-text" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;opacity: 0;">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
        <div style="display:none" class="ttt">
                <input type="text" name="us_head_pic" value="{$info.us_head_pic}">
                <input type="text" name="id" value="{$info.id}">
            </div>
		
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">登录密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_pwd" style="width:20%">
            </div>
        </div>
        <!-- <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">安全密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_safe_pwd" style="width:20%">
            </div>
        </div> -->

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onclick="return savePro();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 确认提交</button>
			</div>
		</div>
	</form>
</div>

{include file="public/_footer" /}

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">


/**
 * 使用indexof方法实现模糊查询
 * @param  {Array}  list     进行查询的数组
 * @param  {String} keyWord  查询的关键词
 * @return {Array}           查询的结果
 */


$('#btn').on('click',function(){
    let key=$('.select_tel_hidden');
    let array =[];
    for (let i=0;i<key.length;i++){
        array.push(key[i].value)
    }
    let select_tel = $('#select_tel').val();
    fuzzyQuery(array,select_tel)
})

function selectLi(_this) {
    $('.input_iphone').val(_this.innerHTML);
    $('.iphoneInput').hide();
}
function fuzzyQuery(list, keyWord) {
    var arr = [];
    let html='';
    for (var i = 0; i < list.length; i++) {
        if (list[i].indexOf(keyWord) >= 0) {
            html += "<li onclick='selectLi(this)'>"+list[i]+"</li>"
        }
    }
    $('.iphoneInput').html(html);
    $('.iphoneInput').show();
}

function savePro(){
    $.post('{:url("edit")}',$('#form-article-add').serialize()).success(function(data){
    	layer.msg(data.msg);
    	if(data.code){
    		setTimeout(function(){
    			location.href = data.url;
    		},500);
    	}
    });
    return false;
}
function eee(dada) {
        var data = new FormData();
        data.append('file', dada[0].files[0]);
        var index = layer.load(1, { shade: false }); //0代表加载的风格，支持0-2
        $.ajax({
            url: '{:url("store/upload")}',
            type: 'POST',
            data: data,
            cache: false,
            contentType: false,
            processData: false,
            success: function(data) {
                layer.msg(data.msg);
                if (data.code) {
                    $('.logo').attr('src',data.data);
                    $('input[name="us_head_pic"]').val(data.data);
                }
                layer.close(index);
            },
            error: function() {
                layer.close(index);
                layer.msg('上传出错');
            }
        });
    }
</script>
</body>
</html>